/*jslint node:true*/
'use strict';
var events = require('events');
var eventEmitter = new events.EventEmitter();

eventEmitter.on('some_event', function () {
    console.log('some_event 事件触发');
});
setTimeout(function () {
    eventEmitter.emit('some_event');
}, 1000);

eventEmitter.on('event1', function (arg1, arg2) {
    console.log('listener1', arg1, arg2);
});

eventEmitter.on('event1', function (arg1, arg2) {
    console.log('listener2', arg1, arg2);
});

eventEmitter.emit('event1', 'arg1 from emit', 'arg2 from emit');

console.log('程序运行结束');